def remainder(x:Int,xs:List[Int]):List[Int]= xs match {
    case Nil=>Nil
    case y::ys=>x%y :: remainder(x,ys)
}
def remainderCurry(x:Int)(y:Int) = x % y

def remainder2(x:Int, xs:List[Int]) =
    xs map (remainderCurry(x)_)

def remainder3(x:Int, xs:List[Int]) =
    xs map ((y) => x % y)


def isPrime(x:Int)= List.range(2,x) forall ((y) => x % y !=0) 
def isPrime2(x:Int)= !(List.range(2,x) exists ((y) => x % y ==0)) 


def checkPrime(xs:List[Int]):Boolean= xs match {
    case Nil=>true
    case y::ys=>if(y==0) false else checkPrime(ys)
}

def checkPrime2(xs:List[Int]) : Boolean = {
    val list = xs filter ((y) => y == 0)
    list.isEmpty
}

def checkPrime3(xs:List[Int]) : Boolean = {
    xs forall ((x) => x != 0)
}

val l=List.range(2,10) 

//println(l)
println(l map isPrime)
println(l map isPrime2)

//def remainderCurry(x:Int)(y:Int) = x % y

def remainder5 = remainderCurry(5)_
def remainder10 = remainderCurry(10)_
//println(remainder10(3))
